#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "rt_images.h"
#include "loggin.h"
#include "tag_addr_setting.h"

#include <QMainWindow>
#include <QVBoxLayout>
#include <QScreen>
#include <QLabel>
#include <QPushButton>
#include <QStackedWidget>
#include <QPropertyAnimation>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void InitRTImagesWidget();
    void InitIssServerSettingWidget();
    void InitTagAddrSetWidget();
    void paintEvent(QPaintEvent *event);

public slots:
    void switch_page(int idx);
    void switch_button();
    void value_change_event(QVariant);
    void animation_finished();

private:
    QVBoxLayout* m_layout = nullptr;
    QPushButton* m_switch = nullptr;

    QWidget* m_central_widget = nullptr;

    QStackedWidget* m_stack_widget = nullptr;
    RTImagesWidget* m_rt_images_widget = nullptr;
    LogginWidget* m_loggin_widget = nullptr;
    TagAddrSetWidget* m_tag_addr_set = nullptr;

    QPropertyAnimation* m_animation = nullptr;
    bool m_animating = false;
    int m_nextIdx = -1;
    int m_curIdx = -1;
    QVariant m_value;
};
#endif // MAINWINDOW_H
